﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Payton.WP7.Common.Interface;
using System.Threading;

namespace Payton.WP7.Common
{
    public class SNSPollingService : ISNSPollingService
    {
        IAccountManager _am;
        PollingConfiguration _config;
        Timer _timer;
        IStatusService _statusService;

        public SNSPollingService(IAccountManager am,IStatusService statusService)
        {
            _am = am;
            _config = PollingConfiguration.Default;
            _statusService = statusService;
        }

        public void Start()
        {
            if (_timer != null)
                _timer = new Timer(Callback);

            _timer.Change(TimeSpan.FromMilliseconds(100),_config.PollingInterval);
        }

        void Callback(object status)
        {

 
        }

        public void Stop()
        {
            _timer.Change(0, Timeout.Infinite);
        }

        public event EventHandler<SNSPollingEventArgs> OnPollingCompleted;

        

        public void Config(PollingConfiguration config)
        {
            _config = config;
        }
    }

  
}
